package org.jeecg.modules.jd.job;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.jd.service.IJD_goodsService;
import org.jeecg.modules.jd.service.IJD_orderService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 每天凌晨2点定时   京东 获取最新商品信息
 * </p>
 * 9/29
 */
@Slf4j
public class JDOrderTask implements Job {

    @Autowired
    private IJD_orderService jD_orderService;

    private String parameter;

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    /**
     * 定时任务执行入口
     */
    @SneakyThrows
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("京东 订单任务开始运行,dateTime:{}", DateUtils.now());
       // jD_orderService.saveOrder();
        jD_orderService.updateOrderData(parameter);
        log.info("京东商订单任务结束,dateTime:{}", DateUtils.now());

    }
}